home *** CD-ROM | disk | FTP | other *** search
/ Commodore Free 63 / Commodore_Free_Issue_63_2012-08-06_-.d64 / cp_m iv a < prev    next >
Text File  |  2023-02-26  |  12KB  |  459 lines

  1.  
  2. *************************************
  3.          REDISCOVERING CP/M
  4.                Part 4
  5.            By Commodoreman
  6. *************************************
  7.  
  8. After reviewing the information from
  9. these four articles, I realized that
  10. this is as far as I have been with
  11. CP/M. With this realization, this
  12. will be the last article of the
  13. Rediscovery series. However, there
  14. is a lot of information I would like
  15. to research and I plan to use the
  16. Checklist and List of Resources for
  17. this purpose. I also have plans to
  18. write more articles with this
  19. information as well.
  20.  
  21. There has been a lot of information
  22. to absorb during the first three
  23. Parts and this article is no
  24. exception (this is the largest one
  25. so far). I have organized this
  26. article as follows...
  27.  
  28. This intro, briefly discussing my
  29. progress, overview of checklist
  30. items solved, a look to perceived
  31. future dabbling in CP/M, more on ED,
  32. more command utilities, Summary of
  33. learned concepts; followed by the
  34. Checklist and List of Resources.
  35.  
  36. I like the idea of the Checklist. It
  37. helps me to keep an organized list
  38. of questions and things to do. As I
  39. delve deeper into CP/M, there will
  40. be additional items to add. As I
  41. find the answer to a question or
  42. problem, I will cross it off the
  43. list. For easier reference, I will
  44. place at the end of each item that
  45. has been crossed off-where I found
  46. the answer and had documented it
  47. (like this... < Part 4 >).
  48.  
  49. I have been able to strike some from
  50. the list since Part 3. Refer to the
  51. Checklist at the end to see what has
  52. been accomplished.
  53.  
  54. Due to the amount of referencing I
  55. do, the Digital Research Guides (the
  56. one with the User's Guide,
  57. Programmer's Guide, and System
  58. Guide) I will simply reference them
  59. accordingly. If reference is to
  60. other sources, I will do so in a way
  61. which will be easy to distinguish.
  62. Be sure to check the list of sources
  63. at the end of the article.
  64.  
  65. In this, the 4th instalment, I
  66. wanted to continue with more work on
  67. the ED utility. I have been able to
  68. create a file and save it to disk. I
  69. have also re-opened the file to try
  70. to add more text. When I went to
  71. insert text into the file, it did
  72. not display the text already there.
  73. When I typed in some text and saved
  74. it, the new information was appended
  75. to the beginning of the file. I
  76. expect to gain a greater
  77. understanding of how this utility
  78. works (by now I would assume that
  79. many of you are thinking that I
  80. should just find a good word
  81. processor - and that is definitely
  82. one to add to the Checklist).
  83.  
  84. My List of Resources has grown as
  85. well. I have been on the internet
  86. searching for additional material
  87. and have found quite a bit! You will
  88. probably notice this as you view the
  89. List of Resources, and I have listed
  90. individual files with the internet
  91. address for convenience.
  92.  
  93. Also, this information is (or soon
  94. will be) available on my website (as
  95. well as any software I can get a
  96. hold of - see List of Resources for
  97. the URL).
  98.  
  99. Looking ahead to the future, I see a
  100. significant investment in time to
  101. learn more sophisticated concepts -
  102. such as programming in CP/M. This is
  103. likely to be a high-level language
  104. along with some work learning Z80
  105. assembly language. From my current
  106. perspective, I see this being a bit
  107. more difficult as I do not have
  108. direct access to a network of actual
  109. CP/M users. However, I am confident
  110. that with the amount of digital and
  111. paper material I have collected, I
  112. will be able to do quite a bit.
  113. After the basics, I have an interest
  114. in areas of programming software
  115. (and hardware too), so I will
  116. probably focus future efforts there.
  117.  
  118. CHECKLIST ITEMS - ITEMS CROSSED OFF
  119. THE LIST:
  120.  
  121. I tried to access a 5 1/4 CP/M disk
  122. on my tower (windows 98) machine. I
  123. was not able to read this disk. I
  124. was disappointed I was not able to
  125. immediately access this disk.
  126. However, I thought that maybe there
  127. is a utility somewhere for Windows
  128. 98/DOS that can read a CP/M
  129. formatted disk (add to checklist)
  130.  
  131. I found the MS-DOS program AnaDisk.
  132. However, I was unable to read the
  133. CP/M disk with this program also.
  134.  
  135. I Downloaded and ran FreeFile from
  136. Herne. This MS-DOS utility does not
  137. copy or read CP/M disks, although it
  138. boasts the ability to format disks
  139. in numerous formats (I might try
  140. this feature later).
  141.  
  142. The date which is displayed on
  143. startup is the date of the System
  144. Disk. It is likely I'll have to find
  145. a newer updated version (strike one
  146. from the checklist and add another).
  147. See how to set the date after the
  148. section on ED.
  149.  
  150. I have found there are many
  151. high-level languages available for
  152. CP/M. Among these are: BASIC,
  153. FORTRAN, COBOL, APL, C, and PASCAL.
  154. Some programs can be found on
  155. Zimmer's website her
  156. (www.zimmers.net).
  157.  
  158. ED
  159.  
  160. Before I started this session, I did
  161. finally buckle under and switch
  162. monitors. I decided the convenience
  163. of an 80 column display was worth
  164. it. Although, for those of you who
  165. do not have access to such a
  166. monitor, you should still be able to
  167. follow along - remember that to
  168. scroll to the other half of the
  169. screen using the CONTROL key with
  170. the cursor right/left (the cursor
  171. keys at the top of the keyboard).
  172.  
  173. I figured out how to edit an
  174. existing text file. Here's more of
  175. what I learned. In order to see the
  176. text from the file, the text must be
  177. loaded into the memory buffer. When
  178. ED starts, there is RAM allocated
  179. for text. However, unlike most
  180. editors I have seen, ED does not
  181. load the text from the file into the
  182. buffer, this must be done manually.
  183. Here's how to do it...
  184.  
  185. ed test1.tex <RETURN>
  186.  
  187. ED will start with the TEST1.TEX
  188. file. Then the ED prompt will be
  189. displayed...
  190.  
  191. :*
  192.  
  193. To see the text from the TEST1.TEX
  194. file, we need to Append (copy) the
  195. text to the buffer...
  196.  
  197. #a <RETURN>
  198.  
  199. Now the text is copied and ED shows
  200. this...
  201.  
  202. 1:*
  203.  
  204. Enter this in at this prompt again
  205. to see the text printed on the
  206. screen...
  207.  
  208. b#t <RETURN>
  209.  
  210. ED is showing the line numbers of
  211. the text in the file. The line
  212. numbers are not contained in the
  213. file itself, but are there for ease
  214. of editing. If there is a need to
  215. change a specific line, the line
  216. number is provided.
  217.  
  218. Here is what my screen displays...
  219.  
  220. A>b:
  221. B>ed test1.tex
  222.  : *#a
  223. 1: b#t
  224. 1: another line.
  225. 2:
  226. 3:
  227. 4:
  228. 5: Here is a text file for testing
  229. on the Commodore CP/M machine.
  230. 1: *
  231.  
  232. The actual text was displayed
  233. following the ED commands 'b#t'.
  234. Before explaining these commands, I
  235. think it is a good idea to go over
  236. what a Command Point (CP) is...
  237.  
  238. "ED treats a file as a long chain of
  239. characters grouped together in
  240. lines. ED displays and edits
  241. characters and lines in relation to
  242. an imaginary device called the
  243. character pointer (CP). During an
  244. edit session, you must mentally
  245. picture the CP's location in the
  246. memory buffer and issue commands to
  247. move the CP and edit the file
  248. (User's Guide, p. 6-8)".
  249.  
  250. To successfully operate within the
  251. ED environment, it is crucial to
  252. understand what the CP is and how to
  253. manipulate it. By knowing exactly
  254. where the CP is in the text buffer,
  255. we can manipulate our input,
  256. changes, or deletions with
  257. exactness. Remember, as we are
  258. working with ED, while in Insert
  259. mode, we cannot use the DELete key
  260. as we would in a word processor. If
  261. there is a mistake, text will have
  262. to be manipulated via the editor to
  263. correct it (and it is a little more
  264. difficult than just using a word
  265. processor). One thing for sure, as
  266. soon as I get my hands on a decent
  267. text editor, I'll be 'shelving' ED.
  268. Anyway, continuing on...
  269.  
  270. Going back to the screen listing
  271. above, I will add text to line 3.
  272. Here is how it is done...
  273.  
  274. This will be done using the 'L'
  275. (Line command) to instruct ED to
  276. move the CP to line 3. Enter in the
  277. following...
  278.  
  279. 2l <RETURN>
  280.  
  281. ED displays...
  282.  
  283. 3:*
  284.  
  285. Now go into Insert mode by typing
  286. the letter i followed by <RETURN>.
  287. ED is now awaiting input for that
  288. line. Let's type in the following...
  289.  
  290. new line. <RETURN>
  291.  
  292. ESCape out of Insert mode. Type in
  293. the following...
  294.  
  295. b#t <RETURN>
  296.  
  297. and ED will display the updated
  298. buffer text file.
  299.  
  300. Notice the additional text entered
  301. on line 3. I used the Line command
  302. to position the CP. Here we
  303. specified 2L and the CP was placed
  304. in position for line 3.
  305.  
  306. When I typed in 'b#t' ED executed
  307. two commands. The 'b' is actually
  308. the command that moves the CP to the
  309. beginning of the buffer, and the
  310. '#t' is the Type command telling ED
  311. to type out the lines of text from
  312. the CP position to the end of the
  313. file (buffer). This is an important
  314. point to notice. Multiple commands
  315. can be entered at the ED prompt to
  316. perform more than one task at a time.
  317.  
  318. Another thing to watch out for -
  319. notice that there are now 6 lines.
  320. ED actually inserted another line
  321. between 2 and 3. This is where the
  322. new text was placed. What if I did
  323. not want to have a blank line 4?
  324. Simple, I will use the Kill (k)
  325. command. Enter in the following (two
  326. commands will be used)...
  327.  
  328. 3l1k <RETURN>
  329.  
  330. ED will show a 4: prompt, at which
  331. time enter in...
  332.  
  333. b#t <RETURN>
  334.  
  335. and now ED should have printed the
  336. following on the display...
  337.  
  338. 1: another line.
  339. 2:
  340. 3: new line.
  341. 4:
  342. 5: Here is a text file for testing
  343. the Commodore CP/M machine.
  344. 1:*
  345.  
  346. So now what do I do if I had
  347. mistakenly typed this instead...
  348.  
  349. new line
  350.  
  351. Here is what to do (well, one way to
  352. do it)...
  353.  
  354. 1. ESCape from Insert mode
  355.  
  356. 2. We will go to the beginning of
  357.    the buffer by entering in 'b'
  358.  
  359. 3. Move ahead two lines by entering
  360.    in '2L' (L can be upper or lower
  361.    case)
  362.  
  363. 4. Kill line 3 by entering '1k'
  364.  
  365. 5. Go to Insert mode
  366.  
  367. 6. Type in the new line of text
  368.  
  369. 7. ESCape
  370.  
  371. 8. And we're done
  372.  
  373. Basically I deleted the line and
  374. inserted a new one in its place.
  375. But, there is another way of
  376. inserting text to a line. While
  377. analyzing the commands in the User's
  378. Guide, I found another way of
  379. entering text. This method allows
  380. the use of the delete key, if I
  381. catch the mistake before committing
  382. it to the buffer. Here's how it
  383. works...
  384.  
  385. At the ED prompt, enter the
  386. following...
  387.  
  388. iNew line. <RETURN>
  389.  
  390. Notice the 'i' and the 'N' are not
  391. spaced? 'I' signals ED to insert the
  392. characters immediately following to
  393. the current CP in the buffer.
  394.  
  395. This brings up another question, how
  396. do I insert text or make a change to
  397. an existing line (as opposed to
  398. typing the whole line over)?
  399.  
  400. The User's Guide (p. 6-10) provides
  401. us with what we need to know. Moving
  402. the CP requires us to input certain
  403. commands at the ED prompt (we must
  404. mentally picture where the CP is).
  405. By issuing the 'B' Command, we move
  406. the CP to the beginning of the
  407. buffer. If we wanted to go to the
  408. end, we would enter '-B'. To move to
  409. somewhere in-between, we use the 'L'
  410. (line) command. To go to line 12,
  411. the command would look like this -
  412. 11L <RETURN>. If we need to move the
  413. CP within a line, we use the 'C'
  414. command. Like the Line command, we
  415. need to put a number before the 'C'.
  416. A positive number moves the CP to
  417. the right, a negative number moves
  418. the CP to the left.
  419.  
  420. Example:
  421.  
  422. :* b         Move CP to beginning of
  423.              buffer
  424. :* 2L        Position CP at beginning
  425.              of line 3
  426. :* 10C       Move CP 10 characters to
  427.              the right
  428. :* iText.^Z  Insert text at current
  429.              CP. Use CONTROL-Z to
  430.              finish
  431. :* b#t       Move CP to beginning of
  432.              buffer and List text to
  433.              screen
  434.  
  435. Deleting characters is done this
  436. way...
  437.  
  438. :* 2L   Move CP to beginning of
  439.         line 3
  440. :* 10C  Move CP to the 10th character
  441.         of line 3
  442. :* 10D  Delete 10 characters from CP
  443.         to end of line
  444. :* b#t  Move CP to beginning of buf-
  445.         fer and List text to screen
  446.         to be sure 'More text' was
  447.         deleted
  448.  
  449. To me, I found ED to be a bit
  450. strange and awkward to work with.
  451. The User's Guide specifies the
  452. purpose of ED is "used primarily to
  453. create and edit program source files
  454. (p.6-10). For now, what I have
  455. learned about this utility will do.
  456.  
  457.          Continued in part B
  458.  
  459.